package com.oa.framework.org.department.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oa.framework.org.department.domain.Department;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author cuichao
 *
 */
@Component
public interface DepartmentDao extends BaseMapper<Department> {

    /**
     * 加载获取部门(包含职务)信息
     * @return
     */
    List<Department> loadDepartmentIncludeDuties();
    /**
     * 根据部门Id获取部门(包含职务)信息
     * @param departmentId
     * @return
     */
    Department getDepartmentIncludeDuties(Long departmentId);
    /**
     * 根据Id禁用部门
     * @param departmentId
     * @return
     */
   int disableDepartment(Long departmentId);

    /**
     * 职务与部门建立关联
     * @param departmentId
     * @param dutiesId
     * @return
     */
   int buildDepartmentDutyLink(@Param("departmentId") Long departmentId, @Param("dutiesId") List<Long> dutiesId);

    /**
     *  移除职务与部门的关联
     * @param departmentId
     * @return
     */
   int removeDepartmentDutyLink(Long departmentId);
}
